
#include "observer.h"

using namespace std;

int main(int argc, char **argv)
{
	bloger *pbloger = new bloger();
	portal *pportal = new portal();

	rssreader *prssreader = new rssreader("rss reader");
	mailreader *pmailreader = new mailreader("mail reader");

	pbloger->attach(prssreader);
	pbloger->attach(pmailreader);

	pportal->attach(prssreader);
	pportal->attach(pmailreader);

	pportal->publish("portal");
	cout << endl;
	pbloger->publish("bloger");

//	cout << "\nportal detach mail reader" << endl;
//	pportal->detach(pmailreader);
	pportal->publish("portal");

	delete pmailreader;
	delete prssreader;

	delete pportal;
	delete pbloger;

	return 0;
}
